package com.xfhy.wallpaperdemo.account;

import android.accounts.Account;
import android.content.Context;
import android.content.SyncResult;
import android.os.Bundle;
import android.os.RemoteException;


import com.xfhy.wallpaperdemo.DaemonLog;

public class SyncAdapterStubImpl extends SyncAdapterStub {
    public Context mContext;

    public SyncAdapterStubImpl(Context context) {
        this.mContext = context;
    }

    private void requestSync() {
        AccountHelper.requestSync(this.mContext, (Account) null, false);
    }

    /*public void cancelSync(ISyncContext iSyncContext) {
        DaemonLog.d("SyncManager SyncAdapterStubImpl cancelSync");
        requestSync();
    }

    public void onUnsyncableAccount(ISyncAdapterUnsyncableAccountCallback iSyncAdapterUnsyncableAccountCallback) {
        DaemonLog.d("SyncManager SyncAdapterStubImpl onUnsyncableAccount");
        try {
            iSyncAdapterUnsyncableAccountCallback.onUnsyncableAccountDone(true);
        } catch (Throwable th) {
            DaemonLog.d("onUnsyncableAccount error", th);
        }
    }

    public void startSync(ISyncContext iSyncContext, String str, Account account, Bundle bundle) throws RemoteException {
        DaemonLog.d("SyncManager SyncAdapterStubImpl startSync");
        try {
            SyncResult syncResult = new SyncResult();
            syncResult.stats.numIoExceptions = 1;
            if (bundle != null) {
                if (bundle.getBoolean("force", false)) {
                    if (bundle.getBoolean("ignore_backoff", false)) {
                        iSyncContext.onFinished(SyncResult.ALREADY_IN_PROGRESS);
                        return;
                    }
                    iSyncContext.onFinished(syncResult);
                    requestSync();
                    return;
                }
            }
            iSyncContext.onFinished(syncResult);
        } catch (Throwable th) {
            DaemonLog.d("startSync error", th);
        }
    }*/
}
